package com.mxpio.erp.common.inventory.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mxpio.erp.common.purchase.entity.Supply;
import com.mxpio.erp.common.technology.entity.Item;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_INV_SUPPLY_CHAIN")
@Schema(description="供应链")
public class SupplyChain extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "ID_", updatable = false)
	@Generator
	@Schema(description = "ID")
	private String id;
	
	@Column(name = "PN_CODE_")
	@Schema(description = "供应商编号")
	private String pnCode;
	
	@Column(name = "ITEM_CODE_")
	@Schema(description = "物料编码")
	private String itemCode;
	
	@Column(name = "IN_QUALITY_CONTROL_")
	@Schema(description = "是否检验")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String inQualityControl;
	
	@Column(name = "DEFAULT_SUPPLY_")
	@Schema(description = "是否默认")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String defaultSupply;
	
	@Column(name = "HOLD_")
	@Schema(description = "是否冻结")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private String hold;

	@Column(name = "ITEM_PRICE_")
	@Schema(description = "物料价格")
	private BigDecimal itemPrice;

	@Transient
	private Item item;
	
	@Transient
	private Supply supply;
	
}
